<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['项目管理','设备投诉记录']" icon="fa fa-smile-o" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>设备投诉记录</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 230px);">
                                <div class="top_module">
									<span class="module_text">车牌号码</span>
									<div class="s_hover_box">
										<select   class="select2"  id="carNumberSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='del_carNumber()'>x</div>
									</div>
								</div>

								<div class="top_module">
                                    <span class="module_text">厂区名称</span>
                                    <sa-company-tree companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree>                     
                                </div>
								
								<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">后台判断原因</span>
                                    <select name="" class="top_module_select" [(ngModel)]="tableParam.reasons">
                                        <option value="">全部</option>
                                        <option value="1">GPS问题</option>
										<option value="2">算法问题</option>
										<option value="3">传感器问题</option>
										<option value="4">离线问题</option>
										<option value="5">运维问题</option>
										<option value="6">平台问题</option>
										<option value="7">客户问题</option>
                                    </select>
                                </div>
								
								<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">时间类型</span>
                                    <select name="" class="top_module_select" [(ngModel)]="tableParam.dateType">
                                        <option value="">全部</option>
                                        <option value="1">投诉时间</option>
										<option value="2">录入时间</option>
                                    </select>
                                </div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)" ></table-select-date>
								</div>
								<button class="btn btn-primary" (click)="tableSearch()">查询</button>
								<button class="btn btn-primary" (click)="tableAdd()">新增</button>
								<button type="button" class="btn btn-primary" (click)="export_data()"  style="padding: 4px 12px;">导出</button>
							</div>
							<!-- <div class="right top-search">
								<input type="text" [(ngModel)]="tableParam.searchKey" (change)="tableSearch()" class="search-input" placeholder="维修点/联系人/联系电话/地址">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="tableSearch()"> <i class="fa fa-search"></i></button>
							    </span>
							</div> -->
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>厂区名称</th>
										<th>车牌号码</th>
										<th>投诉问题</th>
										<th>投诉时间</th>
										<th>投诉截图</th>
										<th>后台判断原因</th>
										<th>是否通知司机</th>
										<th>与司机通话截图</th>
										<th>最后拨打时间</th>
										<th>通话时长</th>
										<th>通话次数</th>
										<th>拨打人</th>
										<th>是否维修</th>
										<th>维修时间</th>
										<th>未维修原因</th>
										<th>预约维修时间</th>
										<th>备注</th>
										<th>录入人</th>
										<th>录入时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.companyName}}</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.complainPhenomenon}}</td>
										<td>{{row.complainTime}}</td>
										<td>
											<button *ngIf="row.complainPath" type="button" (click)="showImg1(row,imgModal1)">查看</button>
										</td>
										<td>
											<span *ngIf="row.reasons == '1'">GPS问题</span>
											<span *ngIf="row.reasons == '2'">算法问题</span>
											<span *ngIf="row.reasons == '3'">传感器问题</span>
											<span *ngIf="row.reasons == '4'">离线问题</span>
											<span *ngIf="row.reasons == '5'">运维问题</span>
											<span *ngIf="row.reasons == '6'">平台问题</span>
											<span *ngIf="row.reasons == '7'">客户问题</span>
										</td>
										<td>
										    <span *ngIf="row.isNotice == '0' && row.conversationPath.length == 0 &&(!row.callDuration || row.callDuration < 1)">没有通知</span>
										    <span *ngIf="row.isNotice == '1' || row.conversationPath.length != 0 || (row.callDuration && row.callDuration > 0)">通知</span>
										</td>
										<td>
											<button *ngIf="row.conversationPath" type="button" (click)="showImg2(row,imgModal2)">查看</button>
										</td>
										<td>{{row.callTime}}</td>
										<td>
											<span *ngIf="(row.callDuration && row.callDuration > 3)">{{row.duration}}</span>
											<span style="color: red;" *ngIf="(!row.callDuration || row.callDuration < 4)">{{row.duration}}</span>
										</td>
										<td>
											<span *ngIf="row.callCount && row.callCount != 0">
												{{row.callCount}}
											</span>
										</td>
										<td>{{row.callUser}}</td>
										<td>
										    <span *ngIf="row.isFix == '0'">否</span>
										    <span *ngIf="row.isFix == '1'">是</span>
										</td>
										<td>{{row.fixTime}}</td>
										<td>{{row.noRepairedReason}}</td>
										<td>{{row.appointRepairedTime}}</td>
										<td>{{row.remark}}</td>
										<td>{{row.enterMan}}</td>
										<td>{{row.enterTime}}</td>
										<td>
											<button type="button" *ngIf="row.isFix == '0' || !row.fixTime" (click)="tableTong(row)">同步维修状态</button>
											<button type="button" style="color: #777;" *ngIf="row.isFix == '1' && row.fixTime" (click)="tableTong(row)">已维修</button>
											<button type="button" (click)="tableEdit(row)">编辑</button>
											<button type="button" (click)="tableDel(row)">删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 图片查看   弹窗-->
		<section bsModal #imgModal1="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-lg">
				<div class="modal-content" style="width: 570px;">
					<div class="modal-header">
						<button type="button" class="close" (click)="closeImgModal1(imgModal1)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
						<h4 class="modal-title">投诉截图</h4>
					</div>
					<div class="modal-body">
						<div class="imagesInfo1">
							<div class="imgShow" *ngFor="let item of imgLocalList" (click)="bigimg('Modal1',item)">
								<img [src]="item" alt="投诉截图"  style="cursor: pointer;"/>
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>
		<!-- 图片查看 弹窗end-->
		<!-- 图片查看   弹窗-->
		<section bsModal #imgModal2="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-lg">
				<div class="modal-content" style="width: 570px;">
					<div class="modal-header">
						<button type="button" class="close" (click)="closeImgModal2(imgModal2)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
						<h4 class="modal-title">与司机通话截图</h4>
					</div>
					<div class="modal-body">
						<div class="imagesInfo2">
							<div class="imgShow" *ngFor="let item of imgLocalList" (click)="bigimg('Modal2',item)">
								<img [src]="item" alt="与司机通话截图"  style="cursor: pointer;"/>
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>
		<!-- 图片查看 弹窗end-->
	</sa-widgets-grid>
</div>